//
//  ComplaintController.m
//  FengyuanXS
//
//  Created by 王冬 on 2020/7/30.
//  Copyright © 2020 王冬. All rights reserved.
//

#import "ComplaintController.h"
#import <WebKit/WebKit.h>
#import "MessageController.h"
@interface ComplaintController ()
@property (weak, nonatomic) IBOutlet UIView *backView;
@property (nonatomic, strong)WKWebView *webView;
@property (weak, nonatomic) IBOutlet UIButton *phoneBtn;
@end

@implementation ComplaintController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"投诉检举";
    [self.phoneBtn setTitle:[TokenManager getHotTel] forState:UIControlStateNormal];
    self.webView = [[WKWebView alloc] init];
    self.webView.scrollView.bounces = false;//禁止滑动
    [self.webView.scrollView setShowsVerticalScrollIndicator:NO];

    [self.webView.scrollView setShowsHorizontalScrollIndicator:NO];

    
    [self.backView addSubview:self.webView];
    self.tableView.tableFooterView = [UIView new];
    
    UIEdgeInsets padding = UIEdgeInsetsMake(10, 10, 10, 10);
    [self.webView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.backView).with.insets(padding);
    }];
    
}

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    self.navigationController.navigationBar.hidden = NO;
    [self getdata];
}

-(void)getdata{
    [[ToastManager shardInstance]showSystemProgress:self.view];
    [[ApiManager ShardInstance]getDetailNoticeID:@"29" resultBlock:^(NSDictionary *data, NSError *error) {
        BaseModel *model = [BaseModel mj_objectWithKeyValues:data];
        if (model.code == 1) {
            [[ToastManager shardInstance]hideProgress:self.view];
            [self.webView loadHTMLString:[NSString stringWithFormat:@"%@",data[@"rs"][@"content"]] baseURL:nil];
        }
        
    }];
}
- (IBAction)commitBtn:(BoardButton *)sender {
    
    MessageController *messageVC = [MessageController loadStroyboard:[MessageController new]];
    
    [self.navigationController pushViewController:messageVC animated:YES];
    
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
